package com.hmsm.server.util;

public class UniqueNum {
	public static int num=1;
	public static int index = 1;
	public static long currTime=System.currentTimeMillis();
	
	public static String getUniqueID(){
		StringBuffer sb = new StringBuffer();
		if(currTime==System.currentTimeMillis()){
			num++;
			if(num>999){
				index++;
				num = 1;
			}
		}else{
			currTime = System.currentTimeMillis();
			num = 1;
			index = 1;
			return String.valueOf(currTime);
		}
		sb.append(currTime);
		sb.append(index);
		sb.append(num);
		return sb.toString();
	}
}
